{{#canvas-block-wrapper as |wrapper|}}
  {{canvas-block-title
    block=titleBlock
    editingEnabled=editingEnabled
    hasContent=hasContent
    isFocused=wrapper.isFocused
    isMultiBlock=isMultiBlock
    fetchTemplates=fetchTemplates
    actionsComponent=titleActionsComponent
    bylineComponent=titleBylineComponent
    onBlockDeletedLocally=(action 'blockDeletedLocally')
    onBlockMetaReplacedLocally=(action 'blockMetaReplacedLocally')
    onBlurBlock=wrapper.onBlurBlock
    onBlockContentUpdatedLocally=(action 'blockContentUpdatedLocally')
    onDoubleSelectAll=(action 'doubleSelectAll')
    onDoubleSelectToEnd=(action 'doubleSelectToEnd')
    onDoubleSelectToStart=(action 'doubleSelectToStart')
    onFocusBlock=wrapper.onFocusBlock
    onRedo=(action 'redo')
    onUndo=(action 'undo')
    onMultiBlockSelectUp=(action 'multiBlockSelectUp')
    onMultiBlockSelectDown=(action 'multiBlockSelectDown')
    onNavigateDown=(action 'navigateDown')
    onNavigateLeft=(action 'navigateLeft')
    onNavigateRight=(action 'navigateRight')
    onNavigateUp=(action 'navigateUp')
    onNewBlockInsertedLocally=(action 'newBlockInsertedLocally')
    pasteBlocksAfter=(action pasteBlocksAfter)
    onTemplateApply=(action 'templateApply')}}
{{/canvas-block-wrapper}}

{{canvas-drop-bar afterBlockId=titleBlock.id}}

{{#each contentBlocks as |block|}}
  {{#canvas-block-wrapper
    block=block
    canvasID=canvas.id
    canvasLinkComponent=canvasLinkComponent
    commentThreadComponent=commentThreadComponent
    comments=(if commentsEnabled canvas.comments)
    commentsEnabled=commentsEnabled
    filter=filterTerm as |wrapper|}}
    {{component (block-component-name block.type)
      block=block
      cardDidLoad=(action 'cardDidLoad')
      filterTerm=filterTerm
      canvasAPIURL=canvas.apiURL
      canvasID=canvas.id
      canvasLinkComponent=canvasLinkComponent
      isFocused=wrapper.isFocused
      isMultiBlock=isMultiBlock
      isTemplate=canvas.isTemplate
      githubAuthComponent=githubAuthComponent
      slackAuthComponent=slackAuthComponent
      editingEnabled=editingEnabled
      changeBlockType=(action 'changeBlockType')
      fetchUploadSignature=fetchUploadSignature
      onBlockDeletedLocally=(action 'blockDeletedLocally')
      onBlockReplacedLocally=(action 'blockReplacedLocally')
      onBlurBlock=wrapper.onBlurBlock
      onDoubleSelectAll=(action 'doubleSelectAll')
      onDoubleSelectToEnd=(action 'doubleSelectToEnd')
      onDoubleSelectToStart=(action 'doubleSelectToStart')
      onFocusBlock=wrapper.onFocusBlock
      onRedo=(action 'redo')
      onUndo=(action 'undo')
      onMultiBlockSelectUp=(action 'multiBlockSelectUp')
      onMultiBlockSelectDown=(action 'multiBlockSelectDown')
      onNavigateDown=(action 'navigateDown')
      onNavigateLeft=(action 'navigateLeft')
      onNavigateRight=(action 'navigateRight')
      onNavigateUp=(action 'navigateUp')
      onBlockMetaReplacedLocally=(action 'blockMetaReplacedLocally')
      onBlockContentUpdatedLocally=(action 'blockContentUpdatedLocally')
      onBlockTypeUpdatedLocally=(action 'blockTypeUpdatedLocally')
      onSwapBlockUp=(action 'swapBlockUp')
      onSwapBlockDown=(action 'swapBlockDown')
      onNewBlockInsertedLocally=(action 'newBlockInsertedLocally')
      pasteBlocksAfter=(action pasteBlocksAfter)
      unfurl=(action 'unfurl')}}

    {{#unless block.blocks}}
      {{canvas-drop-bar afterBlockId=block.id adjustSpacing=true}}
    {{/unless}}
  {{/canvas-block-wrapper}}
{{/each}}
